#include "../../network/src/tcpconnection.h"
#include "tcpconnectionpool.h"
#include <boost/bind.hpp>

TcpConnectionPool::TcpConnectionPool()
{

}

TcpConnectionPool::~TcpConnectionPool()
{

}

TcpConnectionPool::ConnectionPtr TcpConnectionPool::alloc(Service &service)
{
    ConnectionPtr _new(m_pool.construct(service), boost::bind(&TcpConnectionPool::destroy, this, _1));

    return _new;
}

void TcpConnectionPool::destroy(TcpConnection *p)
{
    m_pool.destroy(p);
}
